<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--  引入核心皮肤-->
    <link rel="stylesheet" href="../../layui/css/layui.css">
    <!--   引入核心js-->
    <script src="../../layui/layui.js"></script>
    <script>
        layui.use(['layer', 'jquery', 'table', 'form'], function () {
            let layer = layui.layer;//定义组件
            let $ = layui.jquery;//定义组件
            let table = layui.table;//定义表格组件
            let form = layui.form;//定义表格组件
            table.render({
                elem: '#choice',
                url: '../../choice/showChoice',
                //page: true,//开启分页
                parseData: function (res) {
                    console.log(res)
                    return {
                        "code": 0
                        , "msg": ""
                        , "count": 10
                        , "data": res
                    }
                },
                cols: [[ //表头
                    {type: 'checkbox'}
                    , {field: 'chid', title: '题目编号'}
                    , {field: 'chquestion', title: '题目内容'}
                    , {field: 'chquestiona', title: '选项'}
                    , {field: 'chquestionb', title: '选项'}
                    , {field: 'chquestionc', title: '选项'}
                    , {field: 'chquestiond', title: '选项'}
                    , {field: 'chanswer', title: '答案'}
                    , {field: 'check', title: '解析'}
                    , {field: 'subject', title: '科目'}
                    , {field: 'score', title: '得分', templet: "#choiceScore"}
                ]]
            })
            $("#btn-choice").click(function (){
                alert("提交成功");
            })
            table.render({
                elem: '#fillbacks',
                url: '../../fillbacks/showFill',
                //page: true,//开启分页
                parseData: function (res) {
                    console.log(res)
                    return {
                        "code": 0
                        , "msg": ""
                        , "count": 10
                        , "data": res
                    }
                },
                cols: [[ //表头
                    {type: 'checkbox'}
                    , {field: 'qno', title: '题目编号'}
                    , {field: 'question', title: '题目内容'}
                    , {field: 'answer', title: '答案'}
                    , {field: 'check', title: '解析'}
                    , {field: 'subject', title: '科目'}
                    , {field: 'score', title: '得分', templet: "#fillbacksScore"}
                ]]
            })
            $("#btn-fillbacks").click(function (){
                alert("提交成功");
            })
            table.render({
                elem: '#torf',
                url: '../../torf/showTorf',
                //page: true,//开启分页
                parseData: function (res) {
                    console.log(res)
                    return {
                        "code": 0
                        , "msg": ""
                        , "count": 10
                        , "data": res
                    }
                },
                cols: [[ //表头
                    {type: 'checkbox'}
                    , {field: 'qno', title: '题目编号'}
                    , {field: 'question', title: '题目内容'}
                    , {field: 'answer', title: '答案'}
                    , {field: 'check', title: '解析'}
                    , {field: 'subject', title: '科目'}
                    , {field: 'score', title: '得分', templet: "#torfScore"}
                ]]
            })
            $("#btn-torf").click(function (){
                alert("提交成功");
            })
            table.render({
                elem: '#dg',
                url: '../../subjective/showSub',
                //page: true,//开启分页
                parseData: function (res) {
                    console.log(res)
                    return {
                        "code": 0
                        , "msg": ""
                        , "count": 10
                        , "data": res
                    }
                },
                cols: [[ //表头
                    {type: 'checkbox'}
                    , {field: 'subid', title: '题目编号'}
                    , {field: 'subquestion', title: '题目内容'}
                    , {field: 'subanswer', title: '答案'}
                    , {field: 'check', title: '解析'}
                    , {field: 'subject', title: '科目'}
                    , {field: 'score', title: '得分', templet: "#dgScore"}
                ]]
            })
            $("#btn-dg").click(function (){
                alert("提交成功");
            })
        })
    </script>
    <script type="text/html" id="choiceScore">
        <input type="text"></inpute>
    </script>
    <script type="text/html" id="fillbacksScore">
        <input type="text"></inpute>
    </script>
    <script type="text/html" id="torfScore">
        <input type="text"></inpute>
    </script>
    <script type="text/html" id="dgScore">
        <input type="text"></inpute>
    </script>
</head>
<body>
<a class="layui-btn" lay-event="detail" href="lookstudent.html">返回</a>
<div id="table1">
    <div>
        选择题：
    </div>
    <table id="choice" lay-filter="demoEvent"></table>
    <button id="btn-choice" type="button" class="layui-btn layui-btn-normal" >提交</button>
</div>
<div id="table2">
    <div>
        填空题：
    </div>
    <table id="fillbacks"></table>
    <button id="btn-fillbacks" type="button" class="layui-btn layui-btn-normal" lay-filter="btn-fillbacks">提交</button>
</div>
<div id="table3">
    <div>
        判断题：
    </div>
    <table id="torf"></table>
    <button id="btn-torf" type="button" class="layui-btn layui-btn-normal">提交</button>
</div>
<div id="table4">
    <div>
        主观题：
    </div>
    <table id="dg"></table>
    <button id="btn-dg" type="button" class="layui-btn layui-btn-normal">提交</button>
</div>

</body>
</html>